<% @page_title = "多背一公斤 | 最新活动" %>

<% content_for :head do -%>
  <script type="text/javascript" src="/javascripts/thickbox.js"></script>
  <link rel="stylesheet" href="/stylesheets/thickbox.css" type="text/css" media="screen" />
<% end -%>

<% content_for :sidebar do -%>
<div class="prepend-1">
  <h3 class="nt"><%= link_to image_tag('/images/new_activity.gif'), new_event_path %></h3>
  
  <%= render :partial => 'category', :locals => {:categories_count => @categories_count, :status => 'new'} %>
  
	<%= render :partial => 'searchers/local' %>

  <% if logged_in? -%>
  <h3 class="nt">我参加的活动 <%= title_suffix %></h3>
  <% @my_joineds.each do |p| -%>
		<% unless p.event.has_end? %>
    <h4 class="bottom"><%= link_to p.event.title, event_url(p.event.id) %></h4>
		<hr />   	
			<span class="tip">                                                         
        <%= show_datetime(p.event.start_at, false) %> 开始                                                                              
        <%= p.event.participators.count %> 人参加，<br />
				<%= p.event.comments.count %>条留言  
        (<%= link_to "最新留言", latest_comments_event_url(:id => p.event.id,        
                                                       :width => 500,            
                                                       :height => 400),          
                             													 :class => 'thickbox',                               
                             													 :title => "最新留言" %>)                                
			</span>                                                                    
		<% end %>
		<br />
  <% end -%>
  <% end -%>
</div>
<% end -%>


<h3 class="nt">加入公益活动 <%= title_suffix %> </h3>
<%= render :partial => 'users_go_where', :locals => {:participations => @participations} %>

<a name="latest"></a>
<h3 class="nt">近期活动 <%= title_suffix %></h3>
<%= will_paginate @events %>
<div><%= render :partial => 'event', :collection => @events %></div>
<%= will_paginate @events %>